<?php 
$id=$_POST['id'];   //游戏ID
$type=$_POST['type'];  //下载类型
if(!$id){
  	$return=array(
			'errcode'=>1,
			'info'=>'GM',
            'type'=>'/pay/deposit.html',
		);
		exit(json_encode($return));
}
if(!$type){
  	$return=array(
			'errcode'=>1,
			'info'=>'GM',
            'type'=>'/pay/deposit.html',
		);
		exit(json_encode($return));
}
include '../data/data.php';
$user=$_SESSION['user']; //获取到的用户名
$pass=$_SESSION['pass']; //获取到的密码
$result= mysql_query("SELECT * FROM user WHERE username='$user'", $link);  
$row = mysql_fetch_array($result);
if($pass!=$row['password']){
    	$return=array(
			'errcode'=>1,
			'info'=>'OK',
            'type'=>'/user/user.html',
		);
		exit(json_encode($return));
}
if($row['gm']!='5'){
    	$return=array(
			'errcode'=>1,
			'info'=>'OK',
            'type'=>'/pay/deposit.html',
		);
		exit(json_encode($return));
}else{
$resultk= mysql_query("SELECT * FROM games WHERE id='$id'", $link);  
$rowk = mysql_fetch_array($resultk);
if($type=='phone'){     //苹果
    	$return=array(
			'errcode'=>1,
			'info'=>'OK',
            'type'=>$rowk[ios],
		);
		exit(json_encode($return));
}
if($type=='android'){    //安卓
      	$return=array(
			'errcode'=>1,
			'info'=>'OK',
            'type'=>$rowk[Android],
		);
		exit(json_encode($return));
}}
?>